/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.muni.fi.pb138.videodes.entity;

import java.util.HashSet;
import java.util.Set;

/**
 * Class that represents DVD entity.
 * 
 * @author pseudo
 */
public class Dvd {
    String title;
    DvdType type = null;
    String id = null;
    
    //@XStreamConverter(DvdContentConverter.class)
    Set<Movie> content = new HashSet<Movie>();

    public String getId() {
	return id;
    }

    public DvdType getType() {
	return type;
    }

    public void setType(DvdType type) {
	this.type = type;
    }

    public void setId(String id) {
	this.id = id;
    }

    public Set<Movie> getContent() {
	return content;
    }

    public void setContent(Set<Movie> content) {
	this.content = content;
    }

    public String getTitle() {
	return title;
    }

    public void setTitle(String title) {
	this.title = title;
    }

    /**
     * Two DVDs are the same if they have the same ID.
     * 
     * @param obj the object that is being compared to this object.
     * @return TRUE, if two objects have the same ID, otherwise FALSE
     */
    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Dvd other = (Dvd) obj;
        if ((this.id == null) ? (other.id != null) : !this.id.equals(other.id)) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 79 * hash + (this.id != null ? this.id.hashCode() : 0);
        return hash;
    }
    

    
    @Override
    public String toString() {
        return this.getTitle();
    }
}
